package com.luckberry.murder.service.impl;

import com.luckberry.murder.entity.NPC;
import com.luckberry.murder.mapper.NPCMapper;
import com.luckberry.murder.service.NPCService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class NPCServiceImpl implements NPCService {

    @Resource
    private NPCMapper mapper;

    @Override
    public List<NPC> getNPCs() {
        return mapper.getNPCs();
    }

    @Override
    public NPC getNPC(int nid) {
        return mapper.getNPC(nid);
    }

    @Override
    public List<NPC> getNPCByScript(int sid) {
        return mapper.getNPCByScript(sid);
    }

    @Override
    public boolean addNPC(NPC npc) {
        return mapper.addNPC(npc) == 1;
    }

    @Override
    public boolean editNPC(NPC npc) {
        return mapper.editNPC(npc) == 1;
    }

    @Override
    public boolean deleteNPC(int nid) {
        return mapper.deleteNPC(nid) == 1;
    }
}
